import 'package:banyou_app/app/config/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/src/size_extension.dart';
import 'package:get/get.dart';

class DeleteDialogView extends StatefulWidget {
  final String title;
  final String img;
  const DeleteDialogView(this.title, this.img);

  @override
  State<DeleteDialogView> createState() => _DeleteDialogViewState();
}

class _DeleteDialogViewState extends State<DeleteDialogView> {
  @override
  Widget build(BuildContext context) {
    return UnconstrainedBox(
      child: Container(
          width: 1.sw - 50,
          height: (1.sw - 50) * 312 / 343,
          decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.all(Radius.circular(10.r))),
          child: Stack(
            children: [
              Positioned.fill(
                child: Column(
                  children: [
                    const SizedBox(height: 32),
                    Image.asset(
                      widget.img,
                      width: 148,
                      height: 101,
                    ),
                    const SizedBox(height: 38),
                    Expanded(
                      child: Container(
                        child: Text(widget.title,
                            textAlign: TextAlign.center,
                            style: TextStyle(
                              fontSize: 16.sp,
                              fontWeight: FontWeight.w600,
                              color: ColorConfig.text_label,
                            )),
                      ),
                    ),
                    const SizedBox(height: 20),
                    Container(
                      padding: EdgeInsets.symmetric(horizontal: 26),
                      child: Row(
                        children: [
                          Expanded(
                            child: InkWell(
                              child: Container(
                                height: 45,
                                decoration: BoxDecoration(
                                  color: Color(0xFFEDEDED),
                                  borderRadius: BorderRadius.circular(20),
                                ),
                                child: Center(
                                  child: Text(
                                    "取消",
                                    style: TextStyle(
                                        color: Color(0xFF959595),
                                        fontSize: 16,
                                        fontWeight: FontWeight.w500),
                                  ),
                                ),
                              ),
                              onTap: () {
                                Get.back();
                              },
                            ),
                          ),
                          const SizedBox(width: 30),
                          Expanded(
                            child: InkWell(
                              child: Container(
                                height: 45,
                                decoration: BoxDecoration(
                                  gradient: LinearGradient(
                                      begin: Alignment.centerLeft,
                                      end: Alignment.centerRight,
                                      colors: [
                                        Color(0xFFF52EC5),
                                        Color(0xFFFF8A33),
                                      ]),
                                  borderRadius: BorderRadius.circular(20),
                                ),
                                child: Center(
                                  child: Text(
                                    "确定",
                                    style: TextStyle(
                                        color: ColorConfig.white,
                                        fontSize: 16,
                                        fontWeight: FontWeight.w500),
                                  ),
                                ),
                              ),
                              onTap: () {
                                Get.back(result: 1);
                              },
                            ),
                          ),
                        ],
                      ),
                    ),
                    const SizedBox(height: 20),
                  ],
                ),
              ),
              Positioned(
                  top: 15,
                  right: 15,
                  child: InkWell(
                    onTap: () {
                      Get.back();
                    },
                    child: Image.asset(
                      'assets/images/路径 275@2x.png',
                      width: 20.r,
                    ),
                  ))
            ],
          )),
    );
  }
}
